extends ../layout

block content
	.container
		.row
			.col-md-7
				embed(src="#{movie.flash}", width="100%", height="400", frameborder=0, allowfullscreen="true")
				.panel.panel-default
					.panel-heading
						h3 评论区
					.panel-body
						ul.media-list(id="commentList", style="max-height:500px;overflow-y:auto")
							each item in comments
								li.media
									.pull-left
										img.media-object(style="width:30px;height:30px")
									.media-body
										h4.media-heading #{item.from.name}
										p #{item.content}

						if user
							form(method="post", action="/movie/comment", id="commentForm", data-username="#{user.name}")
								input(type="hidden", name="comment[movie]", value="#{movie._id}")
								input(type="hidden", name="comment[from]", value="#{user._id}")
								.form-group
									textarea.form-control(name="comment[content]", row=4)
								button.btn.btn-primary(type="submit") 提交
						else
							hr
							h5 发表评论，请先登录
				br
				br
				br
				br
				br
				br
			.col-md-5
				dl.dl-horizontal
					dt 电影名字
					dd #{movie.title}
					dt 导演
					dd #{movie.doctor}
					dt 郭嘉
					dd #{movie.country}
					dt 语言
					dd #{movie.language}
					dt 上映年份
					dd #{movie.year}
					dt 简介
					dd #{movie.summary}
					dt 评分
					dd(id="scoreGroup", data-id="#{movie._id}")
						span(class="ui-score-array", data-toggle="popover",  data-placement="bottom", data-content="评分成功！")
							each val, score in ['很差','较差','还行','推荐','力荐']
								a(class="ui-score", data-txt="#{val}", href="javascript:void(0);")
						span(class="ui-score-txt")
						input(type="hidden", value="#{movie.score}" id="scoreData")
	script(src="/js/comment.js")
	script(type='text/javascript').
		new LszhScore( $("#scoreGroup") );